package com.tedu;

import java.util.Arrays;
import java.util.Random;

public class Test004 {
    public static void main (String[] args) {
        //创建方法f1
        //在f1方法中 利用for循环 给数组a[] 5   随机赋值
        //将数组 返回到main方法中   并打印出来
        int[] a = f1();
        System.out.println(Arrays.toString(a));
    }

    private static int[] f1 () {
        int a[] = new int[5];
        Random random = new Random();
        for (int i = 0; i < a.length; i++) {
            int i1 = random.nextInt(100);
            a[i] = i1;
        }

        System.out.println(Arrays.toString(a));
        return a;

    }
}
